package www.my.imageframecompare;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.widget.ImageView;

import com.android.volley.RequestQueue;
import com.android.volley.toolbox.ImageLoader;
import com.android.volley.toolbox.Volley;

import www.my.imageframecompare.VolleyConfig.BitmapCache;

/**
 * Created by 张英杰 on 2016/8/11.
 */
public class ImageLoaderShow extends AppCompatActivity {
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_imageloasershow);
        String img = getIntent().getStringExtra("img");
        BitmapCache bitmapCache = new BitmapCache(this);
        RequestQueue requestQueue = Volley.newRequestQueue(this);
        final ImageLoader imageLoader = new ImageLoader(requestQueue, bitmapCache);
        ImageView iv= (ImageView) findViewById(R.id.iv);
        ImageLoader.ImageListener listener2 = ImageLoader.getImageListener(iv, R.drawable.image_loading, R.drawable.image_error);
        imageLoader.get(img, listener2);
    }
}
